import Vue from 'vue';
import ElementUI from 'element-ui';
import App from './App.vue';
import router from './router';
import store from './store';
import 'element-ui/lib/theme-chalk/index.css';
import axios from '@/maxios/http.js';
import 'font-awesome/css/font-awesome.min.css';


Vue.use(ElementUI);
Vue.config.productionTip = false;

Vue.prototype.$http = axios;

// from 2021-03-10T13:59:15.016345+08:00 to 2021-03-10 13:59:15
Vue.filter("datetimeFormatter", function(value){
  let posT = value.indexOf('T')
  let posDot = value.indexOf('.')
  return value.slice(0, posT)+" "+value.slice(posT+1, posDot)
})

Vue.filter("nicknameEllipsis", function(val){
  if (val.length > 10) {
          return `${val.slice(0, 11)}...`;
        }
        return val;
      })

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app');
